<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字体文件管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					var font = $("#font").val();
					if(font == null || font==""){
		                alertx("<spring:message code='tips.nofont' />");
						return;
					}
					loading('<spring:message code="common.subbmiting"/>');
                    timeVali($("#btnSubmit"));
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/source/font/eleSourceFont/"><spring:message code='source.font.list'/></a></li>
		<li class="active"><a href="${ctx}/source/font/eleSourceFont/form?id=${eleSourceFont.id}">
		<shiro:hasPermission name="source:font:eleSourceFont:edit">
		<c:if test="${not empty eleSourceFont.id}">
					<spring:message code='source.font.modify'/>
				</c:if>
				<c:if test="${empty eleSourceFont.id}">
					<spring:message code='source.font.add'/>
				</c:if>
		</shiro:hasPermission><shiro:lacksPermission name="source:font:eleSourceFont:edit">
		<spring:message code='source.font.add'/></shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="eleSourceFont" action="${ctx}/source/font/eleSourceFont/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label"><spring:message code='source.font.name'/>：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code='source.font.file'/>：</label>
			<div class="controls">
				<form:hidden id="font" path="font" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<sys:ckfinder input="font" type="fonts" uploadPath="/source/font/eleSourceFont" selectMultiple="false" langCode="${langCode}" />
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="source:font:eleSourceFont:view"><input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.save'/>"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="<spring:message code='common.back'/>" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>